// pages/wodeshoucang/wodeshoucang.js
// collection.js
const app = getApp();

Page({
  data: {
    collectionList: [],
  },

  onLoad: function () {
    this.getCollection();
  },

  getCollection: function () {
    // Call the cloud function to get collection data
    wx.cloud.callFunction({
      name: 'getCollection',
      success: (res) => {
        this.setData({
          collectionList: res.result.data,
        });
      },
      fail: (error) => {
        console.error("Failed to get collection", error);
      },
    });
  },
});
